package com.amigo.online.consumer.user.controller;





import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.amigo.online.common.base.controller.BaseConsumerController;
import com.amigo.online.common.core.response.Response;
import com.amigo.online.common.param.dto.user.UserHobbyDto;
import com.amigo.online.consumer.user.service.HobbyService;

/**
 * 用户相关
 * @author amigo
 *
 */
@RestController
@RequestMapping(value = "/hobby", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class HobbyController extends BaseConsumerController {
	
	@Autowired
	private HobbyService hobbyService;
	
	
	@PostMapping("/updateHobby")
	public ResponseEntity<Response> updateUserHobby(@RequestBody UserHobbyDto dto){
		return hobbyService.updateUserHobby(dto);
	}
	
	
	@GetMapping("/{type}")
	public ResponseEntity<Response> getHobby(@PathVariable("type") Integer type){
		return hobbyService.getHobby(type);
	}
}
